package org.zavgame.server;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class CoinsFilter implements Filter {

   @Override
   public void destroy() {
      // nothing to do.
   }

   /**
    * Nothing to do. Just a wrapper for user requests to will make some work.  
    */
   @Override
   public void doFilter(ServletRequest request, ServletResponse response,
         FilterChain chain) throws IOException, ServletException {
      HttpServletResponse httpResponse = (HttpServletResponse) response;
      HttpServletRequest httpRequest = (HttpServletRequest) request;

      // We can make some work here on user requests
      chain.doFilter(httpRequest, httpResponse);

   }

   @Override
   public void init(FilterConfig filterConfig) throws ServletException {
      // nothing to do.
   }

}
